package com.tiancheng.trade.settlement.service.settlement.impl;

import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.tiancheng.trade.settlement.mapper.settlement.SettlementBankBillDetailMapper;
import com.tiancheng.trade.settlement.model.settlement.SettlementBankBillDetail;
import com.tiancheng.trade.settlement.service.settlement.ISettlementBankBillDetailService;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;


/**
 * 银行对账单详情信息
 *
 * @author wangxin
 */
@Slf4j
@Service
public class SettlementBankBillDetailService implements ISettlementBankBillDetailService {

    @Autowired
    private SettlementBankBillDetailMapper settlementBankBillDetailMapper;

    @Override
    public List<SettlementBankBillDetail> queryBankBillDetailList(String order_id) {
        QueryWrapper<SettlementBankBillDetail> conditions = new QueryWrapper<>();
        conditions.eq("order_id", order_id);
        conditions.last("limit 1000");
        return settlementBankBillDetailMapper.selectList(conditions);
    }

    @Override
    public SettlementBankBillDetail queryBankBillDetail(String subOrderId) {
        QueryWrapper<SettlementBankBillDetail> conditions = new QueryWrapper<>();
        conditions.eq("sub_order_id", subOrderId);
        return settlementBankBillDetailMapper.selectOne(conditions);
    }
}
